#include<stdio.h>
#include<malloc.h>

struct emp{
	char name[20];
	int sal;
};

int main(){
	struct emp *e;
	char *mode = "rb";
	FILE *fp;
	char* filename = "data.txt";

	fp = fopen(filename, "rb");
	
	if(fp == NULL)
		printf("\nError in opening file!");
	e = (struct emp *)malloc(sizeof(struct emp));
	fread(e, 1, sizeof(struct emp), fp);
	printf("%s\n%d\n", e->name, e->sal);
	fclose(fp);
	return 0;
}
